package cn.mjnxin.charge.service;

import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.mjnxin.charge.model.entity.DemoNote;
import cn.mjnxin.charge.model.entity.DemoNoteExample;
import cn.mjnxin.charge.service.base.BaseRepository;
import cn.mjnxin.charge.mybatis.mapper.DemoNoteMapperExt;
/**
* DemoNoteRepository
* Created by clg on 2023/8/29.
*/
@Repository
public class DemoNoteRepository extends BaseRepository<DemoNote, DemoNoteExample, Integer> {

    private static final Logger LOGGER = LoggerFactory.getLogger(DemoNoteRepository.class);

    @Autowired
    DemoNoteMapperExt mapper;


    @Override
    public DemoNoteMapperExt getMapper() {
        return mapper;
    }

    public List<DemoNote> selectByExamplePage( DemoNoteExample example,Integer pageNo,Integer pageSize){
        if(pageNo==null)pageNo=0;
        if(pageSize==null)pageSize=20;
        example.setLimitStart(pageNo*pageSize);
        example.setLimitLength(pageSize);
        return selectByExample(example);
    }

}
